﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Services;
using System.Xml.Linq;
using System.ServiceModel;
using System.Linq.Expressions;
using WebApp.Domain;
using WebApp.Data;
using WebApp.Service;
using COM.Service;

namespace WebApp.Web
{
    public class WcfServiceBase
    {
        protected IDatabaseFactory databaseFactory = COM.Web.Unity.Instance.GetService<IDatabaseFactory>();
        protected IRuntimeService runtimeService = COM.Web.Unity.Instance.GetService<IRuntimeService>();
        protected IConfigService configService = COM.Web.Unity.Instance.GetService<IConfigService>();

        protected TempFileUser User
        {
            get
            {
                return this.runtimeService.Permission.CurrentUser as TempFileUser;
            }
        }

        protected TempFileDbContext DbContext
        {
            get
            {
                return this.databaseFactory.Get();
            }
        }
    }
}